<%--
  Created by IntelliJ IDEA.
  User: LMY
  Date: 2025/6/22
  Time: 10:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
    <head>
        <title>登录页面</title>
        <script>
            //动态注册表单提交事件
            window.onload = function () {
                //获取form的dom对象
                var form = document.getElementById("form");
                form.onsubmit = function() {
                    //用户名非空校验
                    if (form.username.value == "") {
                        alert("用户名不能为空!")
                        return false;
                    }
                    return true;
                }
            }
        </script>
    </head>
    <body>
        <h1>管理后台登录</h1>
        <form action="<%=request.getContextPath()%>/login" id="form" method="post">
            u: <input type="text" name="username" /><br/><br/>
            p: <input type="password" name="password" /><br/><br/>
            <input type="submit" value="用户登录"/>
        </form>
    </body>
</html>
